<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('员工信息列表')" />
    <th:block th:include="include :: layout-latest-css" />
    <th:block th:include="include :: ztree-css" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>姓名：</label>
                                <input type="text" name="userName"/>
                            </li>
                            <li>
                                <label>电话：</label>
                                <input type="text" name="telephone"/>
                            </li>
                            <li>
                               审批状态：<select name="approvalStatus">
                              <!--  <option value="">所有</option>-->
                                <option value="0">待审核</option>
                                <option value="1">已审核</option>
                            </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.addTab()" shiro:hasPermission="system:info:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:info:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:info:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:info:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
     <th:block th:include="include :: layout-latest-js" />
     <th:block th:include="include :: ztree-js" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:info:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:info:remove')}]];
        var sexDatas = [[${@dict.getType('sys_user_sex')}]];
        var statusDatas = [[${@dict.getType('status')}]];
        var prefix = ctx + "system/info";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateApprovalIdeaUrl:prefix+'/editApprovalIdea/{id}',
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                detailUrl:prefix+'/detail/{id}',
                exportUrl: prefix + "/export",
                modalName: "员工信息",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '',
                    visible: false
                },
                {
                    field: 'userName',
                    title: '姓名'
                },
                {
                    field: 'sex',
                    title: '用户性别',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(sexDatas, value);
                    }
                },
                {
                    field: 'nation',
                    title: '民族'
                },
                {
                    field: 'birthTime',
                    title: '出生时间'
                },
                {
                    field: 'age',
                    title: '年龄'
                },
                {
                    field: 'wokeTime',
                    title: '工作时间'
                },
                {
                    field: 'firstDegree',
                    title: '第一学历'
                },
                {
                    field: 'highestDegree',
                    title: '最高学历'
                },
                /*{
                    field: 'identityNum',
                    title: '身份编号',
                    visible: false
                },*/
                {
                    field: 'identityCardNum',
                    title: '身份证号码'
                },
                {
                    field: 'graduateSchool',
                    title: '毕业院校'
                },
                {
                    field: 'graduationMajor',
                    title: '毕业专业'
                },
                {
                    field: 'telephone',
                    title: '电话'
                },
                {
                    field: 'address',
                    title: '家庭住址'
                },
                {
                    field: 'isParty',
                    title: '是否党员'
                },
                {
                    field: 'isMarriage',
                    title: '婚否'
                },
                {
                    field: 'emergencyName',
                    title: '紧急联系人姓名'
                },
                {
                    field: 'emergencyTelephone',
                    title: '紧急联系电话'
                },
                {
                    field: 'beforeCorporate',
                    title: '原工作单位名称'
                },
                {
                    field: 'beforePost',
                    title: '原工作岗位'
                },
                {
                    field: 'remark',
                    title: '审批原因'
                },
                {
                    field: 'f1',
                    title: '身份证照片',
                    formatter: function(value, row, index) {
                        return $.table.imageView(value);
                    }
                },
                {
                    field: 'f2',
                    title: '学历证明',
                    formatter: function(value, row, index) {
                        return $.table.imageView(value);
                    }
                },
                    {
                        field: 'f8',
                        title: '学位证明',
                        formatter: function(value, row, index) {
                            return $.table.imageView(value);
                        }
                    },
                {
                    field: 'f3',
                    title: '个人证件照',
                    formatter: function(value, row, index) {
                        return $.table.imageView(value);
                    }
                },
                {
                    field: 'f4',
                    title: '工资银行卡号',
                    formatter: function(value, row, index) {
                        return $.table.imageView(value);
                    }
                },
                {
                    field: 'f5',
                    title: '职业资格证书',
                    formatter: function(value, row, index) {
                        return $.table.imageView(value);
                    }
                },
                {
                    field: 'f6',
                    title: '体检报告',
                    formatter: function(value, row, index) {
                        return $.table.imageView(value);
                    }
                },
                {
                    field: 'f7',
                    title: '户口本',
                    formatter: function(value, row, index) {
                        return $.table.imageView(value);
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                      /*  actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');*/
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-edit"></i>查看详情</a> ');
                        actions.push('<a class="btn btn-warning btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="ajaxByStatus(\'' + row.id + '\')"><i class="fa fa-edit"></i>待审核</a> ');
                        actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="$.operate.editApprovalIdea(\'' + row.id + '\')"><i class="fa fa-edit"></i>拒绝</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });


        function ajaxByStatus(id) {
          layer.confirm("确认要审核嘛？",{btn:['确定','拒绝'],title:"提示"},function() {
                $.ajax({
                    url:prefix+'/editSatus/'+id,
                    type:'post',
                    dataType:'json',
                    async:false,
                    success:function (res) {
                       if(res.code==0){
                           layer.msg(res.msg,{icon:6},function () {
                               location.reload();
                           })
                       }else{
                           layer.msg(res.msg,{icon:5})
                       }
                    },
                    error:function (error) {
                        console.log(error)
                    }
                })
            },function () {

          })
        }
    </script>
</body>
</html>



